/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.chapter.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * chapter_infoEntity
 * @author lonjey
 * @version 2018-11-10
 */
@Table(name="chapter_info", alias="a", columns={
		@Column(name="chapterid", attrName="chapterid", label="章节id", isPK=true),
		@Column(name="bookid", attrName="bookid", label="书籍id"),
		@Column(name="name", attrName="name", label="章节名", queryType=QueryType.LIKE),
		@Column(name="address", attrName="address", label="章节地址"),
		@Column(name="updatatime", attrName="updatatime", label="更新时间"),
	}, orderBy="a.chapterid DESC"
)
public class ChapterInfo extends DataEntity<ChapterInfo> {
	
	private static final long serialVersionUID = 1L;
	private String chapterid;		// 章节id
	private String bookid;		// 书籍id
	private String name;		// 章节名
	private String address;		// 章节地址
	private Date updatatime;		// 更新时间
	
	public ChapterInfo() {
		this(null);
	}

	public ChapterInfo(String id){
		super(id);
	}
	
	public String getChapterid() {
		return chapterid;
	}

	public void setChapterid(String chapterid) {
		this.chapterid = chapterid;
	}
	
	@NotBlank(message="书籍id不能为空")
	@Length(min=0, max=255, message="书籍id长度不能超过 255 个字符")
	public String getBookid() {
		return bookid;
	}

	public void setBookid(String bookid) {
		this.bookid = bookid;
	}
	
	@Length(min=0, max=255, message="章节名长度不能超过 255 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=255, message="章节地址长度不能超过 255 个字符")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdatatime() {
		return updatatime;
	}

	public void setUpdatatime(Date updatatime) {
		this.updatatime = updatatime;
	}
	
}